Skip to content

Add WASM support: --wasm flag with Node.js and Deno runtimes#1

Open
lostflydev wants to merge 1 commit intomainfrom
scala-wasm-support
Open

Add WASM support: --wasm flag with Node.js and Deno runtimes#1
lostflydev wants to merge 1 commit intomainfrom
scala-wasm-support

Conversation

@lostflydev
Copy link
Owner

Implements scala-cli issue VirtusLab#3316: integrate WebAssembly with Scala CLI.

What's added

  • --wasm CLI flag and //> using wasm directive to enable WASM output
  • --wasm-runtime <runtime> option and //> using wasmRuntime directive Supported values: node (default), deno, wasmtime, wasmedge, wasmer
  • --deno-version, --wasmtime-version, --wasmer-version options and corresponding directives for pinning runtime versions

Runtime support

@lostflydev lostflydev force-pushed the scala-wasm-support branch 5 times, most recently from c6453eb to ddfadbc Compare March 9, 2026 05:51
Implements scala-cli issue VirtusLab#3316: integrate WebAssembly with Scala CLI.

- `--wasm` CLI flag and `//> using wasm` directive to enable WASM output
- `--wasm-runtime <runtime>` option and `//> using wasmRuntime` directive
  Supported values: node (default), deno, wasmtime, wasmedge, wasmer
- `--deno-version`, `--wasmtime-version`, `--wasmer-version` options
  and corresponding directives for pinning runtime versions

- **Node.js** (default): runs Scala.js WASM output with
  `--experimental-wasm-exnref` flag, requires Node.js >= 22
- **Deno**: runs Scala.js WASM output; if not found on PATH,
  downloads from GitHub releases via Coursier cache
- **Wasmtime / WasmEdge / Wasmer**: return UnsupportedWasmRuntimeError
  pending upstream Scala.js standalone WASM support (scala-js/scala-js#4991)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant